// 对外暴露常量路由
const routers = [
  {
    path: '/',
    component: () => import('@/views/home/index.vue'),
    meta: { keepAlive: true },
  },
  {
    path: '/center',
    component: () => import('@/views/center/index.vue'),
    meta: { keepAlive: true },
    name: 'center', //命名路由
  },
  {
    path: '/manage',
    component: () => import('@/views/manage/index.vue'),
    requireAdmin: true,
    meta: { keepAlive: true },
  },
  {
    path: '/echart',
    //@ts-ignore
    component: () => import('@/views/echart/index.vue'),
    requireAdmin: true,
    meta: { keepAlive: true },
  },
  {
    path: '/personal/:username',
    component: () => import('@/views/personal/index.vue'),
  },
  {
    path: '/user-manage/useradd',
    component: () => import('@/views/user-manage/userAdd.vue'),
    requireAdmin: true
  },
  {
    path: '/user-manage/userlist',
    component: () => import('@/views/user-manage/userList.vue'),
    requireAdmin: true,
    meta: { keepAlive: true },
  },
  {
    path: '/goods-manage/goodsadd',
    component: () => import('@/views/goods-manage/goodsAdd.vue'),
  },
  {
    path: '/goods-manage/goodsEdit/:id',
    component: () => import('@/views/goods-manage/goodsEdit.vue'),
  },
  {
    path: '/news-manage/newsadd',
    component: () => import('@/views/news-manage/newsAdd.vue'),
  },
  {
    path: '/news-manage/newslist',
    component: () => import('@/views/news-manage/newsList.vue'),
    meta: { keepAlive: true },
  },
  {
    path: '/news-manage/newsedit/:id',
    component: () => import('@/views/news-manage/newsEdit.vue'),
  },
  {
    path: '/404',
    component: () => import('@/views/404/index.vue'),
    name: '404', //命名路由
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/404',
    name: 'Any',
  },
]

export default routers
